package com.example.pkmedical.Activity.warning;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;

import com.example.pkmedical.Base.BaseActivity;
import com.example.pkmedical.R;
import com.example.pkmedical.Utils.CommandUtil;
import com.example.pkmedical.Utils.FinishActivityManager;
import com.example.pkmedical.Utils.SerialProtUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class BackFootErrorActivity extends BaseActivity {

    @BindView(R.id.backfooterror_img)
    ImageView backfooterrorImg;
    @BindView(R.id.backfooterror_closebt)
    Button backfooterrorClosebt;
    private int mType = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_backfooterror);
    }

    @Override
    public void initData() {
        switch (mType){
            case 0:
                backfooterrorImg.setImageResource(R.drawable.img_back_leg_up);
                break;
            case 1:
                backfooterrorImg.setImageResource(R.drawable.img_back_up);
                break;
            case 2:
                backfooterrorImg.setImageResource(R.drawable.img_leg_up);
                break;
        }
        SerialProtUtil.getInstance().sendBytes200(2, CommandUtil.REMIND_MESSAGE);
    }

    @Override
    public void initView() {
        Intent intent = getIntent();
        if (intent != null) {
            mType = intent.getIntExtra("errorType",0);
        }
        FinishActivityManager.getManager().addActivity(this);
    }

    @Override
    public void initPresenter() {

    }

    @Override
    public void showDialog(String... msg) {

    }

    @OnClick(R.id.backfooterror_closebt)
    public void onViewClicked() {
        BackFootErrorActivity.this.finish();
    }
}
